﻿using System;
using System.Text.RegularExpressions;

class UrlsExtract
{
    static void Main()
    {
        string urlPattern = @"(www\.|http://)([\d|\w]+\.{1})([\w]+)";
        string text = "fgfdg jfdj www.abv.bg kjfghjfd fdfgn12 http:// http://nakov.com dfgfdgfhttp://dfgfdg http://nqmanishto http://www.dir.bg";
        Match match = Regex.Match(text, urlPattern);
        while (match.Success)
        {
            Console.WriteLine(match.Value);
            match = match.NextMatch();
        }
    }    
}
